export class StorageHelper {
    constructor(prefix = '') {
        this.prefix = prefix;
    }

    set(key, value) {
        wx.setStorageSync(`${this.prefix}_${key}`.toUpperCase(), value);
    }

    get(key) {
        return wx.getStorageSync(`${this.prefix}_${key}`.toUpperCase());
    }

    remove(key) {
        wx.removeStorageSync(`${this.prefix}_${key}`.toUpperCase());
    }

    clear() {
        wx.clearStorageSync();
    }
}

export const defaultStorage = new StorageHelper('default')